//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<XPopup.h>
///	@path	~/src/gui/xgui/
///	@date	2008/09/30
///	@desc	.

#pragma once

#include "xeres.h"

#include "gui/image/IBitmap.h"
#include "gui/xgui/XFrame.h"
#include "gui/xgui/XDesktop.h"

namespace xeres {

	/*! 
		\class	XPopup
		\brief	Pop-up window encapsulation.
	*/
	class XPopup : public XFrame
	{
	public:

		/// \ctor
		XPopup( void );

		/// \ctor
		XPopup( const Rect<int>& placement );

		/// \ctor
		XPopup( const Pair<int>& size );

		/// \dtor
		virtual ~XPopup( void );

		DECL_IOBJECT_CLASS_DYNAMIC( XPopup , XFrame );

	public:

		/// \name XGui Component Attributes
		//@{

		/// \brief	Call when focus in.
		virtual void OnFocusIn( Updater& updater , RefWeak<IGuiComp> last );

		/// \brief	Call when focus out.
		virtual void OnFocusOut( Updater& updater , RefWeak<IGuiComp> next );
		
		/// \brief	Draw background.
		virtual void OnDrawBackground( Composition& composition );

		/// \brief	Set background.
		virtual void SetBackground( RefWeak<IBitmap> bmp );

		//@}

	private:

		// @data
		Ref<XPopup>		m_subPopup;
		Ref<IBitmap>	m_background;
	};
	
	
} // namespace xeres
